import { CrowdRangeEnum, PlanSchemeStatusEnum, objTypeEnum, preferentialEnum, scopeEnum, thresholdEnum } from "./enum";
import { GoodsTypes } from "./goods";

export namespace PlanSchemeTypes{
    export interface planSchemeItem{
        id: number;
        title: string;
        scope: number;
        promoTypeId: number;
        crowdRange: number;
        status: number;
        creator: string;
        createTime: string;
        schemeStairs: Partial<ISchemeStairs>[];
        goods:Partial<GoodsTypes.IGoodsItem>[];
        packages:any[];
        categories:number[];
    }

    export type PlanSchemePage = {
        id:string,
        title:string,
        status:string,
        threshold:string,
        type:string
    }

    export type PlanSchemeTableData = {
        id: number;
        status: PlanSchemeStatusEnum;
        title: string;
        scope: scopeEnum;
        crowdRange: CrowdRangeEnum;
        threshold: thresholdEnum;
        type: preferentialEnum;
        creator: string;
        createTime: string;
        updator: string;
        updateTime: string;
    }


    export interface ISchemeStairs{
        threshold: number;
        thresholdNum: number;
        gears:Partial<ISchemeGears>[]
    }



    export interface ISchemeGearsGoodsItem{
        goodsCode?: number;
        goodsName?: string;
        quantity?: number;
        type?: objTypeEnum;
        schemeGearId?: number;
        id: number; 
    }

    export interface ISchemeGears{
        dataType: number;  
        type: number; //优惠类型
        value: number; //优惠值',
        objType: number;
        descr: string; //优惠券名称或指定商品名称',
        descrValue: string;
        gifts:ISchemeGearsGoodsItem[];
        goods:ISchemeGearsGoodsItem[];
        packages:any[]
    }

}

